package jicheng1;

public class Fly {
   private String  name;
   private String sex;

    public Fly(String name, String sex) {
        this.name = name;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
    public void drive(Plane plane){

        System.out.println("驾驶员"+name+"性别是"+sex+",驾驶着"+plane.getType()+"悠然自得");
        if (plane instanceof Warcraft){
            ((Warcraft) plane).lauch();
        }
        plane.fly();
        plane.speed();
        plane.landing();

    }
}
